package com.yutian.springbootvue.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;

@Controller
@RequestMapping("/hello")
public class HelloController {


	@GetMapping("/")
    public String hello(HttpServletRequest httpRequest){
	    String name = null != httpRequest.getAttribute("name") ? httpRequest.getAttribute("name").toString() : "未知用户";
        return name;
    }

}
